package cn.iocoder.yudao.module.lowcode.controller.admin.datasource.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Schema(description = "低代码 - 低代码数据源配置新增/修改 Request VO")
@Data
public class LowcodeDataSourceConfigSaveReqVO {

    @Schema(description = "编号", example = "1")
    private Long id;

    @Schema(description = "数据源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试数据源")
    @NotEmpty(message = "数据源名称不能为空")
    private String name;

    @Schema(description = "数据库类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "mysql")
    @NotEmpty(message = "数据库类型不能为空")
    private String type;

    @Schema(description = "数据源连接URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "jdbc:mysql://127.0.0.1:3306/test")
    @NotEmpty(message = "数据源连接URL不能为空")
    private String url;

    @Schema(description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "root")
    @NotEmpty(message = "用户名不能为空")
    private String username;

    @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
    @NotEmpty(message = "密码不能为空")
    private String password;

    @Schema(description = "驱动类名", example = "com.mysql.cj.jdbc.Driver")
    private String driverClassName;

    @Schema(description = "初始连接数", example = "1")
    private Integer initialSize;

    @Schema(description = "最小空闲连接数", example = "1")
    private Integer minIdle;

    @Schema(description = "最大连接数", example = "8")
    private Integer maxActive;

    @Schema(description = "测试查询语句", example = "SELECT 1")
    private String testQuery;

    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
    @NotNull(message = "状态不能为空")
    private Integer status;

}